package com.naiterui.ehp.bs.emr.utils.enums;

import java.util.Arrays;

/**
 * @Description 患者病例标签
 * @Author gongbaoqiang
 * @Date 2019/11/26 6:06 PM
 */
public enum  RecordTagsEnum {

    /**
     * 患者病例标签
     */
    CREATER(1, "患者病例"),
    VIEWER(2, "共享病例");

    private int code;

    private String name;

    public int getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    RecordTagsEnum(int code, String name){
        this.code = code;
        this.name = name;
    }

    public static String getNameByCode(int code){
        RecordTagsEnum recordTagsEnum = Arrays.stream(values()).
                filter(s -> s.getCode() == code).findFirst().orElseGet(null);
        return recordTagsEnum == null ? "" : recordTagsEnum.getName();
    }

}
